import {Body, Controller, Post} from "@nestjs/common";
import {LoginWebUserDto, RegWebUserDto} from "../user/dto/req-web-user.dto";
import {WebAuthService} from "./web-auth.service";


@Controller('web/auth')
export class WebAuthController {

    constructor(
        private readonly  webAuthService: WebAuthService,
    ) {
    }

    @Post('/login')
    async login(@Body() body: LoginWebUserDto) {
        return  this.webAuthService.login(body)
    }

    @Post('/reg')
    async register(@Body() body:RegWebUserDto) {
        return this.webAuthService.create(body)
    }
}
